<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fnx" uri="http://java.sun.com/jsp/jstl/functionsx" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <style>
        .box-body {
            min-width: 960px;
        }

        .tabs {
        }

        .tabs li {
            float: left;
            background-color: #f4f4f4;
            border-left: 1px solid #e2e2e2;
            border-top: 1px solid #ddd;
            border-right: 1px solid #ddd;
            margin-right: 0px;
        }

        .tabs li a {
            color: #555555;
            float: left;
            text-decoration: none;
            padding: 5px 12px;
        }

        .tabs li a:link, .tabs li a:visited, .tabs li a:hover, .tabs li a:active {
            text-decoration: none;
        }

        .tabs li.active {
            background-color: #FFFFFF;
            border-left: 1px solid #ddd;
            border-top: 1px solid #ddd;
            border-right: 1px solid #ddd;
        }

        .tabs li.active a {
            color: #fff;
            background: #ed5565;
            border-color: #ed5565;
        }

        .tabs li.hover {
            background-color: #e7e7e7;
            border-left: 1px solid #ddd;
            border-top: 1px solid #ddd;
            border-right: 1px solid #ddd;
        }

        .tabs li.hover a {
            color: #000;
        }

        .header {
            height: 60px;
            padding: 10px;
            margin-bottom: 10px;
        }

        .header input {
            height: 40px;
            border: 1px solid #333;
            outline: none;
            text-align: center;
        }

        .header a {
            display: inline-block;
            height: 40px;
            width: 60px;
            text-align: center;
            line-height: 36px;
            border: 1px solid #333;
            padding: 1px;
            color: #333;
        }

        .header a:hover {
            background: #2c3b41;
            color: #fff;
        }

        .main ul {
            padding-left: 40px;
        }

        .main a {
            color: #333;
        }

        .main li {
            width: 100%;
            height: 200px;
            padding-left: 40px;
            border-left: 1px solid #333;
            list-style: none;
            padding-right: 30px;
            margin-bottom: 20px;
        }

        .main .cont {
            border: 1px solid #333;
            height: 100%;
            position: relative;
            padding: 10px;
        }

        .main .cont:before {
            content: '';
            display: table;
            height: 20px;
            border-left: 1px solid #333;
            position: absolute;
            top: -21px;
            left: -42px;
        }

        .main a:hover {
            background: #2c3b41;
            color: #fff;
        }
    </style>
    <script type="text/javascript">


        $(function () {
            $("#validForm").validate();
            $("input[name='name']").focus();
            $('#myTabs a').click(function (e) {
                e.preventDefault()

                if ($(e.target).attr("name") == 'addroom') {

                    $("#roomcontent").val("");
//                    $("#imageName").src("");
                    $("#roombeanId").val("");
                    $("#video").val("");
                    $("#time").val("");

                }
                $(this).tab('show')
            })
            if ('${tab}' == "room") {
                $("#profile1").addClass("active").siblings().removeClass("active");
                $("#tab2").addClass("active").siblings().removeClass("active");
            }
            if ('${tab}' == "Liveroom") {
                $("#profile").addClass("active").siblings().removeClass("active");
                $("#tab3").addClass("active").siblings().removeClass("active");
            }
        });

        function confirmDelete() {
            return confirm("<s:message code='confirmDelete'/>");
        }

        function chooseInfo() {
            var connInfoid = $("#connInfoid").val();
            var title = $("#title").val();

            location.href = '/cmscp/core/flash_big/chooseinfolist.do?tab=profile&returnUrl=core/flash_big_news/node_choose_info&connInfoid=' + connInfoid + '&title=' + title;
        }


        function optSingle(opt) {
            if (Cms.checkeds("ids") == 0) {
                alert("<s:message code='pleaseSelectRecord'/>");
                return false;
            }
            if (Cms.checkeds("ids") > 1) {
                alert("<s:message code='pleaseSelectOne'/>");
                return false;
            }
            var id = $("input[name='ids']:checkbox:checked").val();
            location.href = opt + id;
        }

        function optMulti(form, action, msg) {
            if (Cms.checkeds("ids") == 0) {
                alert("<s:message code='pleaseSelectRecord'/>");
                return false;
            }
            if (msg && !confirm(msg)) {
                return false;
            }
            form.action = action;
            form.submit();
            return true;
        }

        function optDelete(form) {
            if (Cms.checkeds("ids") == 0) {
                alert("<s:message code='pleaseSelectRecord'/>");
                return false;
            }
            if (!confirmDelete()) {
                return false;
            }
            form.action = 'comment_delete.do?stat=${stat}&liveId=${liveid}&tab=Liveroom';
            form.submit();
            return true;
        }
        
        function  delAllRoom() {
          if(confirm("您是否确定 删除全部 直播间内容？")){
            location.href='delAllRoom.do?liveId=${liveid}';
          }
        }
        
        function delAllComment() {
          if(confirm("您是否确定 删除全部 聊天室内容？")){
            location.href='delAllComment.do?stat=${stat}&liveId=${liveid}';
          }
        }

    </script>

</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<div class="content-header">
    <h1>直播间</h1>
</div>

<%--<video src="../../../../static/img/888piC8n888piCHFX.mp4" width="30%" height="30%" autoplay="autoplay" controls="controls" style="margin: 0 auto;display: block;" ></video>--%>
<video id=example-video width=600 height=300 class="video-js vjs-default-skin" controls preload="auto"
       style="clear:both;display:block;margin:auto">
    <%--<c:if test="${ stat eq '1'}">--%>
        <source src="http://liveshow.sctv.com:1935/scgc/sctv1deu5453w/index.m3u8" type="application/x-mpegURL">
    <%--</c:if>--%>
    <%--<c:if test="${ stat eq '2'}">--%>
        <%--<source src="http://wowzascgc.sctv.com:1935/live933/live933MjAxNy0xMC0xMiAxNDozOTo1NQ/playlist.m3u8" type="application/x-mpegURL">--%>
    <%--</c:if>--%>

    <%--<source src="./../../../static/img/888piC8n888piCHFX.mp4" type="video/mp4"></source>--%>
</video>

<script>
    var player = videojs('example-video');
    player.play();

    function getImgs() {
        var url = "";
        $("#imagesContainer input[name='imagesImage']").each(function () {
            var u = $(this).val();
            url += u + ',';
        });
        $('#imageName').val(url);


        var count = $("#imagesContainer input[name='imagesImage']").length;
        if (count == 1) {
            var photo = "";
            $("#imagesContainer input[name='imagesImage']").each(function () {
                photo = $(this).val();
            });
            if (photo == "") {
                alert("<s:message code='voidePhoto.Url'/>");
                return false;
            }
            <%--var voideName = $("#video").val();--%>
            <%--if(voideName==""){--%>
            <%--alert("<s:message code='voideUrl.isnotNUll'/>");--%>
            <%--return false;--%>
            <%--}--%>

        }

    }

    function clearView() {
        $("#imagesContainer").html("");
    }
</script>

<div class="content">
    <div class="box box-primary">

        <div class="box-header with-border"></div>

        <div class="box-body">
            <div class="btn-toolbar ls-btn-bar">
                <a class="btn btn-primary" type="submit"
                   onclick="href='/cmscp/ext/livebroadcast/list.do?stat=${stat}'">返回</a>
            </div>
            <ul class="nav nav-tabs" role="tablist" id="myTabs" style="margin-bottom: 25px;">
                <li role="presentation" id="tab1" class="active"><a href="#home" name="addroom" aria-controls="home"
                                                                    role="tab" data-toggle="tab">添加</a></li>
                <li role="presentation" id="tab2"><a href="#profile1" aria-controls="profile" name="bignew"
                                                     role="tab"
                                                     data-toggle="tab" onclick="clearView()">直播间</a></li>
                <li role="presentation" id="tab3"><a href="#profile" aria-controls="profile1" name="bignew"
                                                     role="tab"
                                                     data-toggle="tab" onclick="clearView()">聊天室</a></li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content live-room-add" style="color: #959595;">


                <div role="tabpanel" class="tab-pane active live-room-add" id="home">
                    <form class="form-horizontal" id="validForm" action="${oprt=='edit' ? 'update' : 'save'}.do"
                          method="post">
                        <tags:search_params/>
                        <f:hidden name="liveId" value="${liveid}"/>
                        <f:hidden name="stat" value="${stat}"/>
                        <f:hidden id="roombeanId" name="id" value="${roombean.id}"/>
                        <input type="hidden" id="redirect" name="redirect" value="edit"/>
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">直播内容</label>
                                    <%--<label class="col-sm-2 control-label"></label>--%>
                                    <f:textarea name="content" id="roomcontent" value="${roombean.content}"
                                                class="col-sm-8 {maxlength:255}" placeholder="请输入直播内容"
                                                style="border-radius: 4px"
                                                rows="5"/>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">时间设置</label>
                                    <div class="col-sm-2">
                                        <input type="text" id="time" name="time"
                                               value="<fmt:formatDate value="${roombean.time}" pattern="yyyy-MM-dd'T'HH:mm:ss"/>"
                                               onclick="WdatePicker({dateFmt:'yyyy-MM-ddTHH:mm:ss'});"
                                               class="form-control"/>
                                    </div>
                                </div>
                            </div>
                            <%------------------------------------------------设置时间------------------------------%>
                        </div>
                        <%----------------------------------------------[  上传   和 展示图片  ]---------------------------------------------------------%>

                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">上传图片</label>
                                    <div class="col-sm-8">
                        <textarea id="imagesTemplateArea" style="display:none;">
                                <div style="display:table;width:100%;margin-top:3px;">
                                    <div style="display:table-cell;vertical-align:middle;">
                                      <input type="hidden" name="imagesName"/>
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <%--<s:message code="info.images.text"/>--%>
                                                图片显示
                                            </span>
                                    <%--&lt;textarea class="form-control" id="imagesText{0}" name="imagesText" rows="2"&gt;{2}&lt;/textarea&gt;--%>
                                            <img src="{1}" width="242" height="131">

                                  </div>
                                  <div class="input-group">
                                    <span class="input-group-addon"><s:message code="fileUrl"/></span>
                                            <f:text class="form-control" id="imagesImage{0}" name="imagesImage"
                                                    value="{1}" onchange="fn_imagesImage{0}(this.value);"
                                                    style="width:500px;"/>
                                        </div>
                                        <div class="form-inline">

                                            <div class="btn-group">

                                              <button class="btn btn-default" type="button"
                                                      id="imagesImage{0}Button"><s:message code='choose'/></button>
                                            </div>
                                        </div>
                                      <script>
                                      $(function () {
                                          Cms.f7.uploads("imagesImage{0}", "imagesText{0}", {
                                              settings: {"title": "<s:message code="webFile.chooseUploads"/>"},
                                              callbacks: {
                                                  "ok": function (src) {
                                                      fn_imagesImage
                                                      {
                                                          0
                                                      }
                                                      (src);
                                                  }
                                              }
                                          });
                                      });
                                      </script>
                                  </div>
                                    <%--<div style="width:200px;display:table-cell;text-align:center;vertical-align:middle;">--%>
                                        <%--<img id="img_imagesImage{0}" style="display:none;"/>--%>
                                      <%--<script type="text/javascript">--%>
                                        <%--function fn_imagesImage {--%>
                                            <%--0--%>
                                        <%--}--%>

                                        <%--(src)--%>
                                        <%--{--%>
                                            <%--Cms.scaleImg("img_imagesImage{0}", 180, 100, src);--%>
                                        <%--}--%>
                                        <%--;--%>
                                        <%--fn_imagesImage--%>
                                        <%--{--%>
                                            <%--0--%>
                                        <%--}--%>
                                        <%--("{1}");--%>
                                      <%--</script>--%>
                                    <%--</div>--%>
                                    <div style="width:54px;display:table-cell;text-align:left;vertical-align:middle;">
                                        <div><button class="btn btn-default" type="button"
                                                     onclick="imagesRemove(this);"><s:message
                                                code='delete'/></button></div>
                                        <div><button class="btn btn-default" type="button"
                                                     onclick="imagesMoveUp(this);"><s:message
                                                code='moveUp'/></button></div>
                                        <div><button class="btn btn-default" type="button"
                                                     onclick="imagesMoveDown(this);"><s:message
                                                code='moveDown'/></button></div>
                                    <%-- <div><button class="btn btn-default" type="button" onclick="addImageRow('','',this);"><s:message code='addRow'/></button></div> --%>
                                    </div>
                                </div>
                                </textarea>
                                        <script type="text/javascript">
                                            var imageRowIndex = 0;
                                            var imageRowTemplate = $.format($("#imagesTemplateArea").val());

                                            function addImageRow(image, text, button) {
                                                var count = $("#imagesContainer input[name='imagesImage']").length + 1;
                                                if (count <= 6) {
                                                    if (button) {
                                                        $(imageRowTemplate(count, image, text)).insertAfter($(button).parent().parent().parent());
                                                    } else {
                                                        $(imageRowTemplate(count, image, text)).appendTo("#imagesContainer");
                                                    }
                                                }
                                                this.setShowHide();
                                            }

                                            function setShowHide() {
                                                var count = $("#imagesContainer input[name='imagesImage']").length;
                                                if (count <= 1) {
                                                    $('#voidSetView').show();
                                                } else {
                                                    $('#voidSetView').hide();
                                                    $('#video').val("");
                                                }
                                            }

                                            function imagesRemove(button) {
                                                var toMove = $(button).parent().parent().parent();
                                                toMove.remove();
                                                this.setShowHide();
                                            }

                                            function imagesMoveUp(button) {
                                                var toMove = $(button).parent().parent().parent();
                                                toMove.prev().before(toMove);
                                            }

                                            function imagesMoveDown(button) {
                                                var toMove = $(button).parent().parent().parent();
                                                toMove.next().after(toMove);
                                            }
                                        </script>
                                        <div class="form-inline">
                                            <div class="btn-group">
                                                <span id="imagesSwfButton"></span>
                                                <button class="btn btn-default" type="button"><s:message
                                                        code="upload"/></button>
                                                <div style="display: none">
                                                    <button class="btn btn-default" id="imagesSwfCancel" type="button"
                                                            onclick="imagesSwfUpload.cancelQueue();" disabled><s:message
                                                            code="cancel"/></button>
                                                </div>
                                                <button class="btn btn-default" type="button"
                                                        onclick="addImageRow('','');">新增图片
                                                </button>
                                                <div>
                                                    <span style="color: red"><h6>注意：上传视频时候带一张图，多张图时，视频不能上传</h6></span>
                                                </div>
                                            </div>
                                            <script type="text/javascript">
                                                var imagesSwfUpload = Cms.swfUploadImages("images", {
                                                    jsessionid: "<%=request.getSession().getId()%>",
                                                    file_size_limit: "${GLOBAL.upload.imageLimit}",
                                                    file_types: "${GLOBAL.upload.imageTypes}"
                                                }, addImageRow);
                                            </script>

                                        </div>
                                        <div id="imagesSwfProgress"></div>
                                        <div id="imagesContainer">
                                            <c:if test="${!empty roombean.image}">
                                                <c:forEach var="images" varStatus="status"
                                                           items="${fn:split(roombean.image,',')}">
                                                    <c:if test="${!empty images}">
                                                        <script type="text/javascript">
                                                            function setViewImage() {
                                                                addImageRow('${images}', '');
                                                            }

                                                            setViewImage();
                                                        </script>
                                                    </c:if>
                                                </c:forEach>
                                            </c:if>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <%----------------------------------------------[  上传   和 展示图片 End  ]----------------------------------------------------%>


                        <%----------------------------------------------[  上传   和 展示上传视频 Start  ]-----------------------------------------------%>
                        <div class="row" id="voidSetView">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">上传视频</label>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <span class="input-group-addon"><s:message code="fileName"/></span>
                                            <f:text class="form-control" id="videoName" name="videoName" value=""
                                                    maxlength="255"/>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon"><s:message code="fileUrl"/></span>
                                            <f:text class="form-control" id="video" name="video"
                                                    value="${roombean.video}"
                                                    maxlength="255"/>
                                        </div>
                                        <div class="input-group">
                                            <span class="input-group-addon"><s:message code="fileLength"/></span>
                                            <f:text id="videoLength" name="videoLength" value=""
                                                    class="form-control {digits:true,max:2147483647}"
                                                    maxlength="10"/>
                                            <span class="input-group-addon"><s:message code="videoTime"/></span>
                                            <f:text class="form-control" id="videoTime" name="videoTime" value=""
                                                    maxlength="100"/>
                                            <span class="input-group-btn">
                                <button class="btn btn-default" id="videoButton" type="button"><s:message
                                        code='choose'/></button>
                                  <%--<span id="videoSwfButton"></span>--%>
                                  <%--<button type="button" class="btn btn-default"><s:message code="upload"/></button>--%>
                                  <%--<button class="btn btn-default" id="videoSwfCancel" type="button"--%>
                                          <%--onclick="videoSwfUpload.cancelQueue();" disabled><s:message--%>
                                          <%--code="cancel"/></button>--%>
                                </span>
                                        </div>
                                        <div id="videoSwfProgress"></div>
                                        <script type="text/javascript">
                                            $(function () {
                                                Cms.f7.videolib("video", "videoName", {
                                                    settings: {"title": "<s:message code="webFile.chooseUploads"/>"}
                                                });
                                            });
                                        </script>
                                        <script type="text/javascript">
                                            var videoSwfUpload = Cms.swfUploadVideo("video", {
                                                jsessionid: "<%=request.getSession().getId()%>",
                                                file_size_limit: "${GLOBAL.upload.videoLimit}",
                                                file_types: "${GLOBAL.upload.videoTypes}"
                                            });
                                        </script>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <input id="imageName" name="image" type="hidden" value=""/>
                        <div class="box-footer">
                            <button class="btn btn-primary" type="submit" id="push" onmouseover=" return getImgs()">发布
                            </button>
                        </div>
                    </form>
                </div>

                <div role="tabpanel" class="tab-pane" id="profile1">
                    <shiro:hasPermission name="core:live_broadcast_room:delAllRoom">
                    <button class="btn btn-primary" type="button" onclick="delAllRoom()">删除全部</button>
                    </shiro:hasPermission>
                    <ul class="cont-ul" style="margin-top: 15px;">
                        <c:forEach var="bean" varStatus="status" items="${pagedList1}">
                            <li class="direct-list clearfix">
                                <div class="cont pull-left">
                                    <input type="text" name="publishDate"
                                           value="<fmt:formatDate value="${bean.time}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                                           class="form-control"
                                           style="padding-left:3px;padding-right:3px;width: 150px;"/>
                                    <div class="cont-details">
                                        <div class="details">
                                                ${bean.content}
                                        </div>
                                        <div>
                                                <%--------------------------------[ 图片 视频 拆分 循环 展示出来  Start]------------------------------%>
                                            <c:if test="${!empty bean.image}">
                                                <c:choose>
                                                    <c:when test="${!empty bean.video}">
                                                        <c:if test="${!empty bean.video}">
                                                            <video src="${bean.video}" controls="controls" height="300"
                                                                   width="400"
                                                                   poster="${fn:split(bean.image,',')[0]}"/>
                                                        </c:if>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <c:forEach var="imgname" varStatus="status"
                                                                   items="${fn:split(bean.image,',')}">
                                                            <c:if test="${!empty imgname}">
                                                                <img src="${imgname}" alt="图片未加载">
                                                            </c:if>
                                                        </c:forEach>
                                                    </c:otherwise>
                                                </c:choose>
                                            </c:if>
                                                <%--------------------------------[ 图片 视频 拆分 循环 展示出来  End]------------------------------%>
                                        </div>
                                    </div>
                                </div>
                                <div class="cont-btn pull-left">
                                    <shiro:hasPermission name="core:live_broadcast_room:edit">
                                        <a id="edit_opt_${bean.id}"
                                            <%--href="edit.do?id=${bean.id}&position=${pagedList1.size+status.index}&${searchstring}"--%>
                                           href="edit.do?id=${bean.id}&stat=${stat}"
                                           class="btn btn-primary">编辑</a>
                                    </shiro:hasPermission>
                                    <shiro:hasPermission name="ext:live_broadcast_room:delete">
                                        <a href="delete.do?ids=${bean.id}&${searchstring}"
                                           onclick="return confirmDelete();" class="btn btn-default">清除</a>
                                    </shiro:hasPermission>
                                </div>
                            </li>
                        </c:forEach>
                    </ul>
                </div>

                <%--------------------------------------------[ 聊天室 ]----------------------------------%>
                <div role="tabpanel" class="tab-pane" id="profile">
                    <div class="box box-primary">
                        <div class="box-body table-responsive">
                            <form id="searchForm" action="list.do" method="get" class="form-inline ls-search">
                                <div class="form-group">
                                <label for="search_CONTAIN_text" style="color: red">评论内容：</label>
                                <input class="form-control input-sm" type="text" id="search_CONTAIN_text" name="search_CONTAIN_text" value="${requestScope['search_CONTAIN_text'][0]}" style="width:650px;"/>
                                </div>
                                <button class="btn btn-default btn-sm" type="submit"><s:message code="search"/></button>
                                <f:hidden name="id" value="${liveid}"/>
                                <f:hidden name="stat" value="${stat}"/>
                                <f:hidden name="tab" value="Liveroom"/>
                            </form>
                            <form action="" method="post">
                                <tags:search_params/>
                                <div class="btn-toolbar ls-btn-bar">
                                    <div class="btn-group">
                                        <shiro:hasPermission name="core:live_broadcast_room:commentaudit">
                                            <button class="btn btn-default" type="button"
                                                    onclick="return optMulti(this.form,'commentaudit.do?stat=${stat}&liveId=${liveid}');">
                                                <s:message
                                                        code="audit"/></button>
                                        </shiro:hasPermission>
                                        <shiro:hasPermission name="core:live_broadcast_room:commentanti_audit">
                                            <button class="btn btn-default" type="button"
                                                    onclick="return optMulti(this.form,'commentanti_audit.do?stat=${stat}&liveId=${liveid}');">
                                                <s:message
                                                        code="antiAudit"/></button>
                                        </shiro:hasPermission>
                                    </div>
                                    <%-----------------------{ 修改 隐藏 --}--%>
                                    <%--<div class="btn-group">--%>
                                    <%--<shiro:hasPermission name="core:live_broadcast_room:comment:edit">--%>
                                    <%--<button class="btn btn-default" type="button"--%>
                                    <%--onclick="return optSingle('/cmscp/core/live_broadcast_room/commentedit.do?stat=${stat}&liveId=${liveid}&id=');"><s:message--%>
                                    <%--code="edit"/></button>--%>
                                    <%--</shiro:hasPermission>--%>
                                    <%--</div>--%>
                                    <div class="btn-group">
                                        <shiro:hasPermission name="core:comment:commentdelete">
                                            <button class="btn btn-core:live_broadcast_room" type="button"
                                                    onclick="return optDelete(this.form);"><s:message
                                                    code="delete"/></button>
                                        </shiro:hasPermission>
                                    </div>
                                    <div class="btn-group">
                                        <shiro:hasPermission name="core:live_broadcast_room:liveConfig">
                                            <button class="btn btn-default" type="button"
                                                    onclick="return setCofig()"><s:message
                                                    code="commentConf.setting"/></button>
                                        </shiro:hasPermission>
                                    </div>
                                    <div class="btn-group">
                                        <shiro:hasPermission name="core:comment:delAllComment">
                                        <button class="btn btn-default" type="button" onclick="delAllComment()">删除全部</button>
                                        </shiro:hasPermission>
                                    </div>
                                    <script type="text/javascript">
                                        function setCofig() {
                                            location.href = '/cmscp/core/live_broadcast_room/liveConfig.do?ftype=Live&infoid=${roomId}&stat=${stat}';
                                        }
                                    </script>
                                </div>
                                <table id="pagedTable"
                                       class="table table-condensed table-bordered table-hover ls-tb">
                                    <thead id="sortHead" pagesort="<c:out value='${page_sort[0]}' />"
                                           pagedir="${page_sort_dir[0]}"
                                           pageurl="list.do?page_sort={0}&page_sort_dir={1}&${searchstringnosort}">
                                    <tr class="ls_table_th">
                                        <th width="25"><input type="checkbox"
                                                              onclick="Cms.check('ids',this.checked);"/></th>
                                        <%--<th width="180"><s:message code="operate"/></th>--%>
                                        <th width="30" class="ls-th-sort"><span class="ls-sort"
                                                                                pagesort="id">ID - 操作</span></th>
                                        <th class="ls-th-sort" width="15%"><span class="ls-sort"
                                                                                 pagesort="creator.id"><s:message
                                                code="comment.creator"/></span></th>
                                        <th class="ls-th-sort"><span class="ls-sort" pagesort="fid"><s:message
                                                code="comment.text"/></span></th>
                                        <%--<th class="ls-th-sort"><span class="ls-sort" pagesort="score"><s:message--%>
                                        <%--code="comment.score"/></span></th>--%>
                                        <%--<th class="ls-th-sort"><span class="ls-sort" pagesort="country"><s:message--%>
                                        <%--code="comment.country"/></span></th>--%>
                                        <th class="ls-th-sort" style="width:10% "><span class="ls-sort"
                                                                                        pagesort="creationDate"><s:message
                                                code="comment.date"/></span></th>
                                    </tr>
                                    </thead>

                                    <%-------------------------------------[ 聊天室 数据 定时 刷新  Start  ]---------------------------------%>
                                    <script type="text/javascript">
                                        function ajaxView(mothe, datatype, data) {
                                            var obj;
                                            var strurl = window.location.host;
                                            $.ajax({
                                                type: "POST",
                                                url: "http://" + strurl + mothe,
                                                dataType: datatype,
                                                data: data,
                                                async: false,
                                                success: function (msg) {
                                                    obj = msg;
                                                },
                                                error: function (msg) {
                                                }
                                            });
                                            return obj;
                                        }

                                        function liveChattingRoom() {
                                            //获取对应的参数
                                            var fid = "${roomId}";//直播间ID
                                            var data = {};
                                            data.fid = fid;
                                            data.ftype = "Live";
                                            data.page = 0;
                                            data.size = 10;
                                            data.page_sort = "creationDate";
                                            data.page_sort_dir = "desc";
                                            var obj = ajaxView("/cmscp/core/live_broadcast_room/liveRoomList.do", "json", data);
                                            var list = obj.data;
                                            var totalPages = obj.totalPages;
                                            var totalElements = obj.totalElements;
                                            var value = "";
                                            for (var i = 0; i < list.length; i++) {
                                                value += "<tr><td>" +
                                                    "<input type='checkbox' name='ids' value='" + list[i].id + "' />" +
                                                    "</td><td>" + list[i].id +
                                                    "<a href='/cmscp/core/live_broadcast_room/commentedit.do?stat=${stat}&liveId=${liveid}&id=" + list[i].id + "'>详情</a>" +
                                                    "</td><td><div>" +
                                                    list[i].username +
                                                    "</div><div>" +
                                                    +list[i].status +
                                                    "</div></td><td><div>" +
                                                    list[i].text +
                                                    "</div></td><td><div>" +
                                                    list[i].score +
                                                    "</div><div>" +
                                                    list[i].ip +
                                                    "</div></td><td><div>" +
                                                    list[i].country +
                                                    "</div><div>" +
                                                    list[i].area +
                                                    "</div></td><td><div>" +
                                                    list[i].creationDate +
                                                    "</div><div>" +
                                                    list[i].auditDate +
                                                    "</div></td></tr>";
                                            }
                                            $('#tableBody').html("");
                                            $('#tableBody').append(value);
                                            console.log(" 刷新数据:" + value);
                                        }

                                        //                                    liveChattingRoom();
                                        //                            //定时 任务
                                        //                                        setInterval(liveChattingRoom, 1000 * 60 );
                                    </script>
                                    <%-------------------------------------[ 聊天室 数据 定时 刷新  End  ]---------------------------------%>
                                    <tbody id="tableBody">

                                    <c:forEach var="bean" varStatus="status" items="${pagedList.content}">
                                        <tr
                                            <%--<shiro:hasPermission--%>
                                            <%--name="core:live_broadcast_room:comment:edit"> ondblclick="location.href=$('#edit_opt_${bean.id}').attr('href');"</shiro:hasPermission>--%>
                                        >
                                            <td>
                                                <input type="checkbox" name="ids" value="${bean.id}"/>
                                            </td>
                                            <shiro:hasPermission name="core:live_broadcast_room:commentedit">
                                                <td><c:out value="${bean.id}"/>
                                                    <a href="/cmscp/core/live_broadcast_room/commentedit.do?stat=${stat}&liveId=${liveid}&id=${bean.id}">详情</a>
                                                </td>
                                            </shiro:hasPermission>

                                            <td>
                                                <div><c:out value="${bean.creator.username}"/></div>
                                                <div><s:message code="comment.status.${bean.status}"/></div>
                                            </td>
                                            <td>
                                                <div><c:out
                                                        value="${fnx:substringx_sis(bean.text,50,'...')}"/></div>
                                            </td>
                                                <%--<td>--%>
                                                <%--<div><c:out value="${bean.score}"/></div>--%>
                                                <%--<div><c:out value="${bean.ip}"/></div>--%>
                                                <%--</td>--%>
                                                <%--<td>--%>
                                                <%--<div><c:out value="${bean.country}"/></div>--%>
                                                <%--<div><c:out value="${bean.area}"/></div>--%>
                                                <%--</td>--%>
                                            <td>
                                                <div><fmt:formatDate value="${bean.creationDate}"
                                                                     pattern="yyyy-MM-dd HH:mm:ss"/></div>
                                                <%--<div><fmt:formatDate value="${bean.auditDate}"--%>
                                                                     <%--pattern="yyyy-MM-dd HH:mm:ss"/></div>--%>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                <c:if test="${fn:length(pagedList.content) le 0}">
                                    <div class="ls-norecord"><s:message code="recordNotFound"/></div>
                                </c:if>
                            </form>
                            <form action="/cmscp/core/live_broadcast_room/list.do" method="get" class="ls-page">
                            <tags:search_params excludePage="true"/>
                            <f:hidden name="id" value="${liveid}"/>
                            <f:hidden name="stat" value="${stat}"/>
                            <f:hidden name="tab" value="Liveroom"/>
                            <tags:pagination  pagedList="${pagedList}"/>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
</body>
</html>